package goods.service;

import goods.service.impl.ShopServiceFeignClientFallback;
import common.model.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Service
@FeignClient(name = "shop-server", fallback = ShopServiceFeignClientFallback.class)
public interface ShopServiceFeignClient {
    /**
     * 查询商品所属商铺
     * @param id
     * @return
     */
    @GetMapping("/shop/getById")
    Result getShopById(@RequestParam("id") Long id);
    /**
     * 根据评论的评分，更新商铺的评分
     * @param shopId 商铺ID
     * @param score 评分
     * @return
     */
    @GetMapping("/shop/updateScore")
    Result updateShopScore(@RequestParam("shopId") Long shopId, @RequestParam("score") Double score);
}
